
package com.otomotion.research.ants.core;

import gnu.cajo.invoke.Remote;
import gnu.cajo.utils.ItemServer;

import java.net.UnknownHostException;
import java.rmi.RemoteException;


import com.otomotion.research.ants.databank.UberRepository;
import com.otomotion.research.ants.information.Coordinate;

public class AntSimulator
{

    /**
     * @param args
     */
    public static void main(String[] args)
    {
        UberRepository r = new UberRepository(10,10,10);
        r.populate(5);
        Gaia g = new Gaia(r);
        Engine e = new Engine(g,r);
        e.start();
        int port = 5635;

        try
        {
            System.out.println("Going online on port " + port);
            Remote.config(null, port, null, 0);
        }
        catch (UnknownHostException ex)
        {
            System.out.println("Host is unknown.  Quitting");
            System.exit(-1);
        }
        try
        {
            ItemServer.bind(r, "aServer");
        }
        catch (RemoteException ex)
        {
            System.out.println("Remote Exception.  ");
            ex.printStackTrace();
        }

    }
}
